package com.zhongjian.technologycal.mall.adapter;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;

import com.zhongjian.technologycal.mall.R;
import com.zhongjian.technologycal.mall.bean.BaseBean;
import com.zhongjian.technologycal.mall.utils.UiUtils;

import java.util.List;

/**
 *
 */

public class HomeHorizontalAdapter extends BaseAdapter {

    private final List<BaseBean> data;
    public HomeHorizontalAdapter(Context context, List<BaseBean> data){
        this.data = data;
    }

    @Override
    public int getCount() {
        return data.size();
    }

    @Override
    public Object getItem(int position) {
        return data.get(position);
    }

    @Override
    public long getItemId(int position) {
        return position;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        View view  = UiUtils.inflate(R.layout.item_home_horizontal_image);
        ImageView imageView = view.findViewById(R.id.iv_home_horizontal);
//        imageView.setImageURI(Uri.parse(data.get(position).getPic()));
//        Glide.with(MyApplication.getAppContext()).load(data.get(position).getPic()).into(imageView);
        return imageView;
    }


}
